home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / DESKLIBC / SOURCES.ZIP / DeskLib / !DLSources / Libraries / Window / c / GetCoords < prev    next >
Text File  |  1995-07-08  |  2KB  |  53 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Window.GetCoords.c
  12.     Author:  Copyright © 1994 Lenny
  13.     Version: 0.01 (20 Nov 1994)
  14.     Purpose: Fill a 'convert_block' structure with the relevant info for
  15.              the specified window.
  16.     History: 0.01 (20 Nov 94) : Added 'Window_GetCoords()'
  17.  
  18. */
  19.  
  20. /* --- LOAD HEADERS ------------------------------------------------------ */
  21.  
  22. /* --- DeskLib ----------------------------------------------------------- */
  23. #include "DeskLib:WimpSWIs.h"          /* Low-level WIMP commands          */
  24.  
  25. #include "DeskLib:Coord.h"             /* OS - workarea coord conversion   */
  26. #include "DeskLib:Window.h"
  27.  
  28. /* === FUNCTION DEFINITIONS ============================================== */
  29.  
  30. /* ----------------------------------------------------------------------- */
  31.  
  32. extern void Window_GetCoords(window_handle wh, convert_block *coords)
  33. /*
  34.  *  The coords 'convert_block' passed into this function is filled
  35.  *  with the relevant info for window 'wh'.
  36.  */
  37. {
  38.     window_state    wstate;
  39.  
  40.     Wimp_GetWindowState(wh, &wstate);
  41.     coords->screenrect.min.x = wstate.openblock.screenrect.min.x;
  42.     coords->screenrect.min.y = wstate.openblock.screenrect.min.y;
  43.     coords->screenrect.max.x = wstate.openblock.screenrect.max.x;
  44.     coords->screenrect.max.y = wstate.openblock.screenrect.max.y;
  45.     coords->scroll.x = wstate.openblock.scroll.x;
  46.     coords->scroll.y = wstate.openblock.scroll.y;
  47.     /*  OR (?)  */
  48. /*    memcpy(coords, &wstate.openblock, sizeof(convert_block));  */
  49.  
  50. }
  51.  
  52. /***************************************************************************/
  53.